	<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<script type="text/javascript">
	function checkForm(){
		var className=$("#className").val();
		var gradeId=$("#gradeId").val();
		if(className==null||className==""){
			$("#error").html("班级名称不能为空！");
			return false;
		}
		if(gradeId==null||gradeId==""){
			$("#error").html("所在班级不能为空！");
			return false;
		}
		return true;
	}
</script>
<div class="data_list">
	<div class="data_content">
		<form class="form-horizontal" action="class!save" method="post" onsubmit="return checkForm()">
		  <div class="control-group">
		    <label class="control-label" style="padding-left: 200px;">班级名称：</label>
		    <div class="controls">
		      <input type="text" id="className" name="c.className" value="${c.className }"/>
		    </div>
		  </div>
		  <div class="control-group">
		    <label class="control-label" style="padding-left: 200px;">所在年级：</label>
		    <div class="controls">
		      <select id="gradeId" name="c.gradeId">
				<option value="">请选择所在年级...</option>
				<c:forEach var="grade" items="${gradeList }">
					<option value="${grade.gradeId }" ${grade.gradeId==c.gradeId?'selected':'' }>${grade.gradeName }</option>
				</c:forEach>
			 </select>
		    </div>
		  </div>
		  <div class="control-group">
		    <label class="control-label" style="padding-left: 200px;">班级描述：</label>
		    <div class="controls">
		      <textarea rows="5" cols="10" id="classDesc" name="c.classDesc">${c.classDesc }</textarea>
		    </div>
		  </div>
		  <div class="control-group">
		    <div class="controls" style="padding-left: 200px;">
		      <input type="hidden" id="classId" name="classId" value="${c.classId }"/><input type="submit" class="btn btn-primary" value="保存"/></td>&nbsp;&nbsp;
				<button class="btn btn-primary" type="button" onclick="javascript:history.back()">返回</button>&nbsp;&nbsp;<font id="error" color="red">${error }</font>
		    </div>
		  </div>
		</form>
	</div>
</div>
